#ifndef MODELLOADER_H
#define MODELLOADER_H

#include <QObject>
#include <QRunnable>
#include <QThread>
#include <QTimer>
#include <QDir>
#include <QFileDialog>
#include <QMessageBox>
#include "commons.h"
#include "inference.h"

class ModelLoader : public QThread
{
    Q_OBJECT
public:
    ModelLoader(QObject* parent = nullptr);
    void init(std::shared_ptr<Inference> inference,bool RunWithCuda,const QString& path, float iou_thres, float conf_thres, const cv::Size& input_shape);

    void run() override;
private:
    bool RunWithCuda=false;
    float iou_thres;
    float conf_thres;
    QString path;
    std::shared_ptr<Inference> inference;// 推理模型
    cv::Size input_shape;

signals:
    void workstarted();

    void workerrored(QString err_msg);
    void workfinished(int stau,QString file1,QString err_msg);
};

#endif // MODELLOADER_H
